<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //数组深拷贝
        // var hobby =['踢毽子','爬山']
        // var hobby1 = []
        // for(var i = 0 ; i < hobby.length ; i++){
        //     hobby1.push(hobby[i])
        // }
        // console.log(hobby1)

        function deepCopy(arr){
            var result = []
            for(var i = 0 ; i < hobby.length ; i++){
           result.push( arr[i])
        }
        return result
        }
        var hobby =['踢毽子','爬山']
        var hobby1=deepCopy(hobby)
        console.log(hobby1)
        console.log(hobby1 === hobby )
    </script>
</body>
</html>